package com.yongbao.model.util;

import com.yongbao.model.dtomapper.DishTimeSettingDtoMapper;
import com.yongbao.model.domain.DishTimeSettingDO;
import com.yongbao.model.vo.DishTimeSettingVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DishTimeSettingConvert {

    public static List<DishTimeSettingVO> buildDishTimeSettingVoList(List<DishTimeSettingDO> dishTimeSettingDOList) {
        if (CollectionUtils.isEmpty(dishTimeSettingDOList)) {
            return Lists.newArrayList();
        }
        List<DishTimeSettingVO> dishTimeSettingVOList = new ArrayList<>();
        for (DishTimeSettingDO dishTimeSettingDO : dishTimeSettingDOList) {
            dishTimeSettingVOList.add(DishTimeSettingDtoMapper.INSTANCE.do2VO(dishTimeSettingDO));
        }

        return dishTimeSettingVOList;
    }
}
